package com.sunshine.schedulegridtest

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.sunshine.schedulegrid.bean.CourseBean
import com.sunshine.schedulegrid.config.ScheduleConfig
import com.sunshine.schedulegrid.utils.CourseList
import com.sunshine.schedulegrid.view.ScheduleView
import kotlinx.android.synthetic.main.activity_main.*
import java.sql.Date
import java.sql.Time

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val scheduleConfig = ScheduleConfig()

        scheduleConfig.apply {
            setScheduleDisplayMode(ScheduleConfig.TIME_MODE)
        }

        val arrayList = ArrayList<Int>()
        arrayList.apply {
            add(1)
            add(2)
        }

        val courseList = CourseList()

        courseList.add(CourseBean("", "高等数学", 1, 5, 8, 0, 60, "东配楼201", "张良", "", arrayList))
        courseList.add(CourseBean("", "大学物理", 1, 1, 4, 60, 90, "东配楼201", "吴涛", "", arrayList))
        courseList.add(CourseBean("", "大学英语", 2, 3, 5, 20, 30, "东配楼201", "郑阳光", "", ArrayList()))
        courseList.add(CourseBean("", "体育", 3, 1, 2, 30, 50, "东配楼201", "吕明阳", "", arrayList))
        courseList.add(CourseBean("", "高级语言程序设计", 4, 3, 4, 10, 50, "东配楼201", "小米粥", "", ArrayList()))
        courseList.add(CourseBean("", "高级语言程序设计", 4, 4, 4, 400, 600, "东配楼201", "小米粥", "", arrayList))
        courseList.add(CourseBean("", "高等数学", 2, 1, 2, 300, 500, "东配楼201", "小团", "", arrayList))
        courseList.add(CourseBean("", "C++程序设计", 1, 9, 10, 90, 120, "东配楼201", "请与", "", arrayList))

        //scheduleConfig.setShowRest(true)


        val scheduleView = ScheduleView(this)

        scheduleView.setScheduleConfig(scheduleConfig)
        scheduleView.setCourseList(courseList)

        root.addView(scheduleView)

    }
}